#!/usr/bin/env python

# INSTRUCTIONS:
# 
# (1) Implement the TextMessage class accordig to docstring specifications.


class CellPhone(object):
    '''Simple cell phone that can ... FIXME

    Instance attributes:

    owner -- string name of the cell phone owner
    '''
    def __init__(self,myowner="no one yet"):
        '''member within cell phone class'''
        self.owner = myowner
    
    def makeCall(self, callWho):
        '''This function will print "calling ... <recipient name>"
        '''
        print "calling",callWho.owner
        callWho.receiveCall(self)
        

    def receiveCall(self, other_phone):
        '''This function will print "receiving call from ... <recipient name>"
        and then calls the function to ring.
        '''
        print "receiving call from",other_phone.owner
        if other_phone.owner == 'Max':
            print "ring ring"
        else:
            print "chirp"

    def hangup(self):
        '''hanging up on caller'''
        print "click"

if __name__ == "__main__":
    mphone = CellPhone("Max")
    cphone = CellPhone("Cole")
    mphone.makeCall(cphone)
    cphone.hangup()
    cphone.makeCall(mphone)
    
